2024-06-11
最后编辑于:2024-06-29
预先静态分配任务,使用链表组织任务队列
可以参考#[embassy_excutor::task]
的设计
通常的实现 ![[assets/截屏2024-06-11 21.54.42.png]] then(OS epoll driven)
loop {
Poll Woken tasks
Wait on epoll() with FDs fron Reactor
Wake tasks with FDs that became ready
}
But
=> So statically allocate tasks ![[assets/截屏2024-06-11 21.59.39.png]] Use an intrusive linked list
![[assets/截屏2024-06-11 22.03.11.png]]
这里my_task
不返回Future
。
SpawnToken
是指向已初始化任务的指针
![[assets/截屏2024-06-11 23.01.44.png]]
中断驱动任务运行 ![[assets/截屏2024-06-11 23.02.12.png]]
No reactor!
![[assets/截屏2024-06-11 23.07.52.png]]Current solution: Just don't do that :)